<template>
  <div class="cain-jurisdiction">
    <div>当前用户:{{ getToken() }}</div>
    <div>
      <a-radio-group
        v-model:value="value1"
        button-style="solid"
        @change="valuechange"
      >
        <a-radio-button value="admin">管理员</a-radio-button>
        <a-radio-button value="editor">观察者</a-radio-button>
      </a-radio-group>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { getToken } from "../../utils/auth";
import routerstore from "../../store/modules/route";
const value1 = ref<string>("admin");
const valuechange = (e: any) => {
  const name = e.target?.value;
  const body = {
    username: name,
    password: "123456",
  };
  const data = routerstore.dispatch("login", body);
  console.log(data)

};
</script>
